package by.dezhits.liltweets.auth;

import oauth.signpost.basic.DefaultOAuthProvider;
import oauth.signpost.commonshttp.CommonsHttpOAuthConsumer;
import oauth.signpost.exception.OAuthCommunicationException;
import oauth.signpost.exception.OAuthExpectationFailedException;
import oauth.signpost.exception.OAuthMessageSignerException;

public class TwitterAuthHelper {

	public static final String CONSUMER_KEY = "7YwqCDtZDEUYdupVIF2fjA";

	public static final String CONSUMER_SECRET = "Nnr6AlZtosW2ZFFYx7Z5VBnN7cx7SrxZNCF5hpcUo";

	public static final String REQUEST_TOKEN_URL = "https://api.twitter.com/oauth/request_token";

	public static final String AUTHORIZE_URL = "https://api.twitter.com/oauth/authorize";

	public static final String ACCESS_TOKEN_URL = "https://api.twitter.com/oauth/access_token";

	public static final String CALLBACK_URL = "app://twitter";

	private static DefaultOAuthProvider provider;
	private static CommonsHttpOAuthConsumer consumer;

	public static DefaultOAuthProvider getProvider() {
		if (provider == null)
			provider = new DefaultOAuthProvider(REQUEST_TOKEN_URL,
					ACCESS_TOKEN_URL, AUTHORIZE_URL);
		return provider;
	}

	public static CommonsHttpOAuthConsumer getConsumer() {
		if (consumer == null)
			consumer = new CommonsHttpOAuthConsumer(CONSUMER_KEY,
					CONSUMER_SECRET);
		return consumer;
	}

	public static String getToken() {
		return consumer.getToken();
	}

	public static String getTokenSecret() {
		return consumer.getTokenSecret();
	}

	

}
